<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>01手写Vue源码</title>
  </head>
  <body>
    <div id="app">
      <h1>vue的例子</h1>
      <p>{{msg}}{{name}}</p>
    </div>
    <script>
      // var str = '1a2b3c4d5e'
      // var reg = /([0-9])[a-z]/g
      // var ret = str.match(reg)
      // // var ret = reg.exec(str)
      // // console.log(RegExp.$1)
      // // console.log(RegExp.$2)
      // // console.log(RegExp.$3)
      // console.log(ret)

      const data = {
        obj: {
          dis: {
            name: 'xx',
          },
        },
      }
      const arr = ['obj', 'dis', 'name']
      const n = arr.reduce((newObj, key) => {
        return newObj[key]
      },data)
      console.log(n)
    </script>
  </body>
</html>
